package com.inspur.cloud.enums;

import java.util.HashMap;
import java.util.Map;

public enum RoleEnum {
	Admin(10) {
		public String toString() {
			return "管理员";
		}
	},
	Tenant(20){
		public String toString() {
			return "租户";
		}
	},
	User(30){
		public String toString() {
			return "用户";
		}
	};

	private final Integer val;

	RoleEnum(Integer n) {
		val = n;
	}

	public Integer getValue() {
		return val;
	}
	private static final Map<Integer, RoleEnum> stringToEnum = new HashMap();
    static {
        for(RoleEnum orderType : values()) {
            stringToEnum.put(orderType.getValue(), orderType);
        }
    }
    
    public static RoleEnum fromInteger(Integer symbol) {
        return stringToEnum.get(symbol);
    }
}